package com.educhains.module.post.service;

import com.educhains.module.demo.vo.Page;
import com.educhains.module.post.vo.Post;
import com.educhains.module.post.vo.PostContent;
import com.educhains.module.post.vo.PostWithContent;

import java.util.List;


public interface PostService {

    Post selectPostByPrimaryKey(String postId);

    PostContent selectPostContentByPrimaryKey(String postId);

    int insertSelective(Post record);

    int updatePostByPrimaryKeySelective(Post record);

    int updatePostContentByPrimaryKeySelective(PostContent record);

    void addReadNum(String postId);


    List<Post> selectPostList();

    List<PostWithContent> showByPage(int start, int end);

    PostWithContent selectPostDetail(String postId);

    int insertContent(PostContent record);

    Page showPostPage(int pageNum, int sortOption);

    Page searchByTitlePage(int pageNum, String titleFragment);

    List<Post> selectPostListLimit(int postNum, String type);

    int deletePostByPrimaryKey(String postId);

    /**
     * Get post list by user id with limit
     *
     * @param userId
     * @param limit
     * @return
     */
    List<Post> getPostListByUserIdWithLimit(String userId, int limit);
}
